import { onUnmounted } from 'vue'

abstract class BaseApi {
  // Register Vue events. Use composition api
  init() {
    onUnmounted(() => {
      this.clear()
      console.log('clear api state onUnmounted')
    })
  }

  // Clear the state when the component is unmounted.
  abstract clear(): void
}

export default BaseApi
